let a1 = [1, 2, 3]
let a2 = [10, 20, 30, 2, 3, 10, 10, 10]
// a1.push(a2)
// let [x, y] = a1
// console.log(x)
// console.log(y)

//并集操作
// a1.push(...a2)
// a1 = a1.concat(a2)
// console.log(a1)

//并集操作去重复
let aa = a1.filter(e => a2.includes(e))
a1.push(...a2.filter(e => !aa.includes(e)))
console.log(a1)
//数组消除重复
let set = new Set(a1)
console.log(Array.from(set))


//交集操作
// a1 = a1.filter(e => a2.includes(e))
// console.log(a1)

//差集操作 a1-a1 = [1]
// let aa = a1.filter(e => a2.includes(e))
// let yy = a1.filter(e => !aa.includes(e))
// console.log(yy)





